def rotate_string(s: str, goal: str):
    if len(s) != len(goal):
        return False
    return goal in (s + s)


print(rotate_string('abcde', 'cdeab'))